#!/bin/bash
HERE="$(dirname "$(readlink -f "${0}")")"
echo ${HERE}
export PREFIX=$HERE/usr
export LD_LIBRARY_PATH=$HERE/usr/lib
export PYTHONHOME=$HERE/usr
export QT_QPA_PLATFORM_PLUGIN_PATH=$HERE/usr/plugins
export QT_XKB_CONFIG_ROOT=$HERE/usr/lib
export FONTCONFIG_FILE=/etc/fonts/fonts.conf
export FONTCONFIG_PATH=/etc/fonts

# SSL
# https://forum.freecadweb.org/viewtopic.php?f=4&t=34873&start=20#p327416
export SSL_CERT_FILE=$PREFIX/ssl/cacert.pem
# https://github.com/FreeCAD/FreeCAD-AppImage/pull/20
export GIT_SSL_CAINFO=$HERE/usr/ssl/cacert.pem

${HERE}/usr/bin/FreeCAD "$@"
